import 'package:flutter/material.dart';

class Widget_Opacity_Page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("Opacity"),
        ),
        body: Opacity(
          opacity: 0.5,
          child: Container(
            width: 100.0,
            height: 100.0,
            margin: EdgeInsets.all(20.0),
            color: Color(0xffff0000),
          ),
        ),
      ),
    );
  }
}

/**     设置子控件透明度
    const Opacity({
    Key key,
    @required this.opacity,//透明度，0.0 到 1.0，0.0表示完全透明，1.0表示完全不透明
    this.alwaysIncludeSemantics = false,
    Widget child,
    })
 */
